<!--寻找并显示斗地主房间的界面-->
<template>
  <div>
    <SearchView></SearchView>
    <RoomsTable @startGame="startGame" @event="event" :ws="ws"></RoomsTable>
  </div>
</template>

<script>
import SearchView from "@/components/game/landlord/searchRoomView/components/SearchView";
import RoomsTable from "@/components/game/landlord/searchRoomView/components/RoomsTable";

export default {
  name: "LandlordRoomSearch",
  components: {RoomsTable, SearchView},
  props:{
    ws:{
      required: true
    },
    user:{}
  },
  data(){
    return{
    }
  },
  beforeMount() {
    //建立连接后,将ws传到父组件去
    let handle = (m) => this.handle(m);
    this.ws.onmessage=function (m){
      handle(m);
    }
  },
  methods:{
    handle(m){
      let data = JSON.parse(m.data);
      switch (data.order){
      }
    },
    startGame(game){
      this.$emit("startGame", game);
    },
    event(){
      this.$emit("event");
    },
  }
}
</script>

<style scoped>

</style>